<?
	class window
	{
		var $cName;
		var $nWidth;
		var $nHeight;
		var $nLeft;
		var $nTop;
		var $cTitle;
		var $cContenido;
		var $bHidden = false;
		var $bResizable = true;
		var $bMoveable = true;
		var $bModal = false;

		function setHidden( $bHidden = true)
		{
			$this->bHidden = $bHidden;
		}
		function setLeft( $nLeft )
		{
			$this->nLeft = $nLeft;
		}
		function setTop( $nTop )
		{
			$this->nTop = $nTop;
		}
		function setHeight( $nHeight )
		{
			$this->nHeight = $nHeight;
		}
		function setWidth( $nWidth )
		{
			$this->nWidth = $nWidth;
		}
		function setBody( $cContenido )
		{
			$this->cContenido = $cContenido;
		}
		function setTitle( $cTitle )
		{
			$this->cTitle = $cTitle;
		}
		function setName( $cName )
		{
			$this->cName= $cName;
		}
		function window( $cName, $cTitle = '', $cContenido = '', $nWidth = 300, $nHeight  = 300, $nLeft = '', $nTop = '')
		{
			$this->cName = $cName;
			$this->cTitle = $cTitle;
			$this->cContenido = $cContenido;
			$this->nWidth = $nWidth;
			$this->nHeight = $nHeight;
			$this->nLeft = $nLeft;
			$this->nTop = $nTop;
		}
		function make()
		{
			$nHeightTitulo = 17;
			$nWidthBotonera = 15;
			$cProperties = "";
			if ( $this->nLeft ) $cProperties .= "left: " . $this->nLeft . "px; ";
			if ( $this->nTop ) $cProperties .= "top: " . $this->nTop . "px; ";
			$cProperties .= "visibility: " .(( $this->bHidden ) ? "hidden": "visible" ) . "; ";
			$cReturn = "<div id=\"". $this->cName . "\" class=\"window\" style=\"z-index: 99; width: " . $this->nWidth. "px; height: " . $this->nHeight . "px;" . $cProperties . "\" >";
			$cReturn .= "<div class=\"title\"  onmouseup=\"mouseUpWindow();\"  onmousedown=\"mouseDownWindow(event, '". $this->cName . "');\" >". $this->cTitle . "!!</div>";
			$cReturn .= "<div class=\"buttons\" ><a href=\"javascript:void(0);\" onclick=\"hideWindow('". $this->cName . "');\" >xcerrar</a></div>";
			$cReturn .= "<div id=\"". $this->cName . "_inside\"  class=\"inside\" style=\"width: " . $this->nWidth . "px; height: " . ($this->nHeight - $nHeightTitulo) . "px;\">" . $this->cContenido . "</div>";
			$cReturn .= "</div>";
			return $cReturn ;
		}
	}
?>